// SPU相关操作
import request,{Method} from '@/libs/api.js'

// 获取需要被审核的SPU商品的分页列表
export function getProductReviewByPage (params) {
    return request({
      url: '/product/spuinfo/getProductReviewByPage',
      method: Method.POST,
      data: params
    });
}

// 审核Spu
export function authSpu (params) {
  return request({
    url: '/product/spuinfo/authSpu',
    method: Method.POST,
    data: params
  });
}

// 获取spu的详情信息
export function getSpuDetail(id){
  return request({
      url : `/product/spuinfo/getSpuDetail/${id}`,
      method: Method.GET,
  })
}

// 获取官方管理端的Spu分页数据
export function getManagerSpuPage (params) {
  return request({
    url: '/product/spuinfo/getManagerSpuPage',
    method: Method.POST,
    data: params
  });
}

// 商品下架
export function productOFF (spuId) {
    return request({
      url: `/product/spuinfo/productOFF/${spuId}`,
      method: Method.PUT,
    });
}